home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / CTools 2.2.1d / CTools / CTools.rsrc / TEXT_147_Temp. Merge.txt < prev    next >
Encoding:
Text File  |  1995-12-01  |  2.5 KB  |  17 lines

  1. Merge Them
  2.  
  3. If you are translating a complete Pascal program, consisting of multiple source and unit files, it is far better to edit ALL the files at once.  Chances are what produces a compiler error in one file will produce them in others.  It‚Äôs better to correct an error throughout the entire source/header area, than to set up ‚ÄúFind/Replace‚Äù several times, one file at a time
  4.  
  5. To do this, get a complete CTools‚Ñ¢ output for ALL the files.  Units and .p files.  Pascal programs sometimes have a ‚ÄúGlobals.p‚Äù file (with whatever actual name).  CTools‚Ñ¢ will save it as ‚ÄúGlobals.p.c‚Äù but it will eventually end up being the main header file, ‚ÄúGlobals.h.‚Äù  What you need to do is MERGE all files (kilobyte size permitting) and put all global data files at the top.  You can separate them back into .c files later, but for the purposes of manual editing, it is essential to have the least number of files (preferably one) as possible.
  6.  
  7. My Think C has been allocated with enough memory to easily handle a 300K merged file.  Set yours up to the maximum possible - within reason.
  8.  
  9. What I do is run all the files through CTools‚Ñ¢ Pascal to C, then select all the output files destined to become headers and drop them on TextMerge by Robert Gibson.  This creates a new file called ‚ÄúMerged File 0‚Äù and consists of copies of the content of all the files in alpha. order (View by Name).  I do the same with what will become sources and it‚Äôs named ‚ÄúMerged File 1‚Äù.  Then I drop both these on the merger and it outputs ‚ÄúMerged File 2‚Äù which I rename to Merged.c.
  10.  
  11. Your alphabetical order is changed by adding an ‚Äòa‚Äô prefix to some file names and a ‚Äòz‚Äô to others, prior to the merge.  Once merged, the Merged File 3 is renamed ‚ÄúMerge.c‚Äù (or the program name) for editing.  Dump the first merges, retaining only the rough translation files (put all their names back like they were) and Merge.c.
  12.  
  13. One advantage is you now have copies of your CTools‚Ñ¢ output, in case you want to revert to, or refer to, any of it in editing the merged file.  But the main advantage is you only have to correct one thing ONCE instead of for each file.  And you do the correction for the whole program the FIRST¬†time it is encountered.
  14.  
  15. Navigation from file to file without excessive scrolling is a snap with CMaster‚Ñ¢ (or your ‚ÄúCommand E‚Äù and then Command G without CMaster‚Ñ¢) by selecting the word ‚Äútranslation‚Äù and using the up/down search arrows.  That‚Äôs a unique word in the merged file and appears at the top of EACH individual file which was merged.
  16.  
  17.